package com.cn.stepLock.lambda;

import java.util.function.Consumer;
import java.util.function.Predicate;

/**
 * @author Aaron
 * @desc
 * @createTime 2020/12/17 16:03
 * @since
 */
public class IfThenElse<T> {

    private T inputParameter;
    private Predicate<T> predicate;
    private Consumer<T> then;
    private Consumer<T> elseFunction;


    public IfThenElse(T inputParameter, Predicate<T> predicate, Consumer<T> then, Consumer<T> elseFunction) {
        this.inputParameter = inputParameter;
        this.predicate = predicate;
        this.then = then;
        this.elseFunction = elseFunction;
    }

    public T getInputParameter() {
        return inputParameter;
    }

    public void setInputParameter(T inputParameter) {
        this.inputParameter = inputParameter;
    }

    public Predicate<T> getPredicate() {
        return predicate;
    }

    public void setPredicate(Predicate<T> predicate) {
        this.predicate = predicate;
    }

    public Consumer<T> getThen() {
        return then;
    }

    public void setThen(Consumer<T> then) {
        this.then = then;
    }

    public Consumer<T> getElseFunction() {
        return elseFunction;
    }

    public void setElseFunction(Consumer<T> elseFunction) {
        this.elseFunction = elseFunction;
    }
}
